// 暴力
    vector<int> twoSum(vector<int>& numbers, int target) {
        int n=static_cast<int>(numbers.size());

        for(int i=0;i<n;i++)
        {
            for(int j=i+1;j<n;j++)
            {
                if(numbers[i]+numbers[j]==target)
                {
                    return vector<int>{i,j};
                }
            }
        }
        return vector<int>{0,0};
    }

// 双指针
    vector<int> twoSum(vector<int>& numbers, int target) {
        int begin=0;
        int end=static_cast<int>(numbers.size()-1);

        while(begin<=end)
        {
            if(numbers[begin]+numbers[end]==target)
            {
                return vector<int>{begin,end};
            }
            else if(numbers[begin]+numbers[end]>target)
            {
                end--;
            }
            else if(numbers[begin]+numbers[end]<target)
            {
                begin++;
            }
        }
        return vector<int>{-1,-1};
    }

// 二分
    vector<int> twoSum(vector<int>& numbers, int target) {

        int n=static_cast<int>(numbers.size());

        for(int i=0;i<n;i++)
        {
            // 固定一个数,去该数的右侧通过二分查找使得i+mid==target
            int left=i+1;
            int right=n-1;

            while(left<=right)
            {
                int mid=(left+right)/2;
                if(numbers[mid]==target-numbers[i])
                {
                    return vector<int>{i,mid};
                }
                else if(numbers[mid]>target-numbers[i])
                {
                    right=mid-1;
                }
                else if(numbers[mid]<target-numbers[i])
                {
                    left=mid+1;
                }
            }
        }

        return vector<int>{-1,-1};
    }